﻿using System.Windows.Controls;
using nRoute.Mapping;
using System.Windows.Media.Animation;

namespace nRoute.Samples.FutureDesktop.Views.Images
{
    [MapNavigationContent("Images/Energy")]
    public partial class ScienceAnimation 
        : UserControl
    {
        private bool _paused;

        public ScienceAnimation()
        {
            InitializeComponent();

            var _sunshiteStoryboard = this.Resources["sunshineStoryboard"] as Storyboard;

            this.Loaded += (s, e) => _sunshiteStoryboard.Begin();
            this.MouseLeftButtonDown += (s, e) =>
            {
                if (_paused)
                    _sunshiteStoryboard.Resume();
                else
                    _sunshiteStoryboard.Pause();
                _paused = !_paused;
            };
        }

    }
}
